package com.redis.seckill.controller;


import com.redis.seckill.lang.Result;
import com.redis.seckill.mq.service.Sender;
import com.redis.seckill.service.ProductService;
import com.redis.seckill.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @since 2020-10-28
 */
@RestController
@RequestMapping("/product")
public class ProductController{


    @Autowired
    private ProductService productService;

    @Autowired
    private Sender sender;

    /**
     * 查看商品
     * @param id
     * @return
     */
    @RequestMapping("/getOne/{id}")
    public Result getOne(@PathVariable("id") Integer id){
        return ResultUtil.success(productService.getOne(id));
    }


}
